<template>
  <div class="form-area">
    <div class="xml-area">{{ xml || 'xml' }}</div>
    <el-form :inline="true" :model="formInfo" class="demo-form-inline">
      <el-form-item label="姓名">
        <el-input v-model="formInfo.name.value" placeholder="姓名"></el-input>
      </el-form-item>
      <el-form-item label="活动区域">
        <el-select v-model="formInfo.region" placeholder="活动区域">
          <el-option label="上海" value="shanghai"></el-option>
          <el-option label="北京" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleSubmit">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'Xml',

  componentName: "Xml",

  components: {},

  data() {
    return {
      xml: '',
      formInfo: {
        name: {
          state: 1,
          value: '秦时明月'
        },
        region: ''
      }
    }
  },

  mounted() {
  },

  methods: {
    handleSubmit(val) {
      // this.xml = this.$x2js.js2xml(this.formInfo);

      let QueryDept= '<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><RecordList><RecordInfo><deptCode>280</deptCode><deptName>产科专家</deptName><parentdeptCode>0500</parentdeptCode><parentdeptName>妇产科</parentdeptName><simplePy>CKZJ</simplePy><fullPy></fullPy><deptIntro></deptIntro><clinicarea>产科门诊</clinicarea><regtype>专家</regtype></RecordInfo><RecordInfo><deptCode>277</deptCode><deptName>儿科专家</deptName><parentdeptCode>0700</parentdeptCode><parentdeptName>儿科</parentdeptName><simplePy>EKZJ</simplePy><fullPy></fullPy><deptIntro></deptIntro><clinicarea>儿科门诊</clinicarea><regtype>专家</regtype></RecordInfo><RecordInfo><deptCode>371</deptCode><deptName>复发性流产专家门诊</deptName><parentdeptCode>0500</parentdeptCode><parentdeptName>妇产科</parentdeptName><simplePy>FFXLCZ</simplePy><fullPy></fullPy><deptIntro></deptIntro><clinicarea>妇科门诊</clinicarea><regtype>专家</regtype></RecordInfo><RecordInfo><deptCode>278</deptCode><deptName>妇科专家</deptName><parentdeptCode>0500</parentdeptCode><parentdeptName>妇产科</parentdeptName><simplePy>FKZJ</simplePy><fullPy></fullPy><deptIntro></deptIntro><clinicarea>妇科门诊</clinicarea><regtype>专家</regtype></RecordInfo><RecordInfo><deptCode>372</deptCode><deptName>生殖免疫专家门诊</deptName><parentdeptCode>0500</parentdeptCode><parentdeptName>妇产科</parentdeptName><simplePy>SZMYZJ</simplePy><fullPy></fullPy><deptIntro></deptIntro><clinicarea>妇科门诊</clinicarea><regtype>专家</regtype></RecordInfo><RecordInfo><deptCode>284</deptCode><deptName>新生儿专家</deptName><parentdeptCode>0700</parentdeptCode><parentdeptName>儿科</parentdeptName><simplePy>XSEZJ</simplePy><fullPy></fullPy><deptIntro></deptIntro><clinicarea>儿科门诊</clinicarea><regtype>专家</regtype></RecordInfo><RecordInfo><deptCode>325</deptCode><deptName>中西医结合妇科专家</deptName><parentdeptCode>2900</parentdeptCode><parentdeptName>中西医结合科</parentdeptName><simplePy>ZXYJHF</simplePy><fullPy></fullPy><deptIntro></deptIntro><clinicarea>中(西)医门诊</clinicarea><regtype>专家</regtype></RecordInfo></RecordList></ResultData></Response>'
      console.log('院区&日期&【普通&专家】-->科室返回:QueryDept')
      let result1 = this.$x2js.xml2js(QueryDept)
      console.log(result1.Response.ResultData.RecordList.RecordInfo)
      console.log('***********科室返回:end***********')

      let QuerySchedule = '<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><RecordList><RecordInfo><medDate>2025-02-13</medDate><deptCode>278</deptCode><deptName>妇科专家</deptName><parentdeptCode>261</parentdeptCode><parentdeptName>妇科综合门诊</parentdeptName><doctCode>8628</doctCode><doctName>於莉英</doctName><doctTech>妇科专家</doctTech><medAmPm>1</medAmPm><regfee>0</regfee><treatfee>3000</treatfee><regAmount>3000</regAmount><scheduleId>5|1|278|8628</scheduleId><restnum>21</restnum></RecordInfo><RecordInfo><medDate>2025-02-13</medDate><deptCode>278</deptCode><deptName>妇科专家</deptName><parentdeptCode>261</parentdeptCode><parentdeptName>妇科综合门诊</parentdeptName><doctCode>8628</doctCode><doctName>於莉英</doctName><doctTech>妇科专家</doctTech><medAmPm>2</medAmPm><regfee>0</regfee><treatfee>3000</treatfee><regAmount>3000</regAmount><scheduleId>5|2|278|8628</scheduleId><restnum>16</restnum></RecordInfo></RecordList></ResultData></Response>'
      console.log('院区&日期&【普通&专家】&科室-->排班返回:QuerySchedule');
      let result2 = this.$x2js.xml2js(QuerySchedule)
      console.log(result2.Response.ResultData.RecordList.RecordInfo)
      console.log('***********排班返回:end***********')

      let querySourceList = '<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><RecordList><RecordInfo><appoNo>1</appoNo><medbegtime>08:00</medbegtime><medendtime>08:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>3</appoNo><medbegtime>08:00</medbegtime><medendtime>08:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>4</appoNo><medbegtime>08:00</medbegtime><medendtime>08:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>7</appoNo><medbegtime>08:30</medbegtime><medendtime>09:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>8</appoNo><medbegtime>08:30</medbegtime><medendtime>09:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>9</appoNo><medbegtime>09:00</medbegtime><medendtime>09:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>10</appoNo><medbegtime>09:00</medbegtime><medendtime>09:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>11</appoNo><medbegtime>09:00</medbegtime><medendtime>09:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>12</appoNo><medbegtime>09:00</medbegtime><medendtime>09:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>13</appoNo><medbegtime>09:00</medbegtime><medendtime>09:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>15</appoNo><medbegtime>09:30</medbegtime><medendtime>10:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>16</appoNo><medbegtime>09:30</medbegtime><medendtime>10:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>17</appoNo><medbegtime>09:30</medbegtime><medendtime>10:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>18</appoNo><medbegtime>10:00</medbegtime><medendtime>10:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>19</appoNo><medbegtime>10:00</medbegtime><medendtime>10:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>20</appoNo><medbegtime>10:00</medbegtime><medendtime>10:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>21</appoNo><medbegtime>10:00</medbegtime><medendtime>10:30</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>22</appoNo><medbegtime>10:30</medbegtime><medendtime>11:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>23</appoNo><medbegtime>10:30</medbegtime><medendtime>11:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>24</appoNo><medbegtime>10:30</medbegtime><medendtime>11:00</medendtime><restNum>21</restNum></RecordInfo><RecordInfo><appoNo>25</appoNo><medbegtime>10:30</medbegtime><medendtime>11:00</medendtime><restNum>21</restNum></RecordInfo></RecordList></ResultData></Response>'
      console.log('院区&日期&【普通&专家】&科室--->排班就诊时间:querySourceList')
      let result3 = this.$x2js.xml2js(querySourceList)
      console.log(result3.Response.ResultData.RecordList.RecordInfo)
      console.log('***********排班就诊时间:end***********')

      let AppointReg = '<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><patientId>YY0139780</patientId><deptName>妇科专家</deptName><parentdeptName></parentdeptName><doctName>於莉英</doctName><regFee>0</regFee><treatFee>1500</treatFee><regAmount>1500</regAmount><medDate>2025-02-13</medDate><address>门诊三楼妇科综合诊区</address><appoNo>1</appoNo><visitNo>1</visitNo><selfFee></selfFee><insurFee></insurFee><insurFeeinfo></insurFeeinfo><transNo></transNo><receiptNo></receiptNo><regFlowId></regFlowId><orderNo>3031987</orderNo><SMKZF></SMKZF><ybOderNo></ybOderNo><ybPayResult></ybPayResult><dzfpcode></dzfpcode></ResultData></Response>'
      console.log('预约:AppointReg')
      let result4 = this.$x2js.xml2js(AppointReg)
      console.log(result4.Response.ResultData);
      console.log('***********预约:end***********')


      let preAppointReg1 = '<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><patientId>YY0027765</patientId><deptName>职工门诊</deptName><parentdeptName>方便门诊</parentdeptName><doctName></doctName><regFee>0</regFee><treatFee>0</treatFee><regAmount>0</regAmount><medDate>2025-02-06</medDate><address>门诊一楼</address><appoNo>0</appoNo><visitNo>0</visitNo><selfFee>0</selfFee><insurFee>0</insurFee><insurFeeinfo></insurFeeinfo><transNo></transNo><receiptNo>ZG001750799</receiptNo><regFlowId>0</regFlowId><orderNo></orderNo><SMKZF>0</SMKZF><ybOderNo></ybOderNo><ybPayResult></ybPayResult><dzfpcode></dzfpcode></ResultData></Response>';


      let preAppointReg2 ='<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><patientId>YY0153816</patientId><deptName>妇科专家</deptName><parentdeptName>妇科综合门诊</parentdeptName><doctName>於莉英</doctName><regFee>0</regFee><treatFee>3000</treatFee><regAmount>3000</regAmount><medDate>2025-02-06</medDate><address>门诊三楼妇科综合诊区</address><appoNo>0</appoNo><visitNo>0</visitNo><selfFee>0</selfFee><insurFee>3000</insurFee><insurFeeinfo>{"setlinfo":{"setl_time":"","cvlserv_pay":0,"hifdm_pay":0,"cvlserv_flag":"0","med_type":"12","exp_content":"","brdy":"1976-01-13","naty":"01","psn_cash_pay":0.0,"certno":"330411197601132244","hifmi_pay":0,"psn_no":"33049999000000003011616962","act_pay_dedc":0,"mdtrt_cert_type":"01","balc":1133.56,"medins_setl_id":"H33048300173202502060832353912","psn_cert_type":"01","acct_mulaid_pay":0,"clr_way":"","hifob_pay":0,"oth_pay":0.0,"medfee_sumamt":30.0,"hifes_pay":0,"gend":"2","mdtrt_id":"330000173880195465704268962342","acct_pay":18.0,"fund_pay_sumamt":12.0,"fulamt_ownpay_amt":15.0,"hosp_part_amt":0,"setl_id":"","inscp_scp_amt":15.0,"insutype":"310","maf_pay":0,"psn_name":"李良芬","psn_part_amt":18.0,"clr_optins":"","pool_prop_selfpay":0.8,"psn_type":"1103","hifp_pay":12.0,"overlmt_selfpay":0,"preselfpay_amt":0,"age":49.0,"clr_type":"11"},"setldetail":[{"fund_pay_type":"310100","fund_payamt":12.0,"setl_proc_info":"","crt_payb_lmt_amt":0,"inscp_scp_amt":0,"fund_pay_type_name":"城镇职工基本医疗保险统筹基金"},{"fund_pay_type":"310200","fund_payamt":18.0,"setl_proc_info":"","crt_payb_lmt_amt":0,"inscp_scp_amt":0,"fund_pay_type_name":"城镇职工基本医疗保险个人账户基金"}]}</insurFeeinfo><transNo></transNo><receiptNo>ZG001750871</receiptNo><regFlowId>0</regFlowId><orderNo></orderNo><SMKZF>0</SMKZF><ybOderNo></ybOderNo><ybPayResult></ybPayResult><dzfpcode></dzfpcode></ResultData></Response>'
      console.log('预结算:AppointReg')
      let result5 = this.$x2js.xml2js(preAppointReg1)
      let result6 = this.$x2js.xml2js(preAppointReg2)
      console.log(result5.Response.ResultData);
      console.log(result6.Response.ResultData);
      console.log('***********预结算:end***********')




      let QueryRegisterRecord = '<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><RecordList><RecordInfo><tradeTime>2025-03-11 00:00:00</tradeTime><medDate>2025-03-11</medDate><medTime>08:00:00-08:30:00</medTime><deptName>感染科/肠道门诊</deptName><doctName></doctName><parentDeptCode>肠道/感染科</parentDeptCode><parentdeptName>148</parentdeptName><appoNo>3</appoNo><scheduleId>3|1|27|0</scheduleId><medAmPm>1</medAmPm><address>文化长廊北西侧</address><appoFrom>1</appoFrom><regFee>0</regFee><treatFee>1500</treatFee><regAmount>1500</regAmount><flowId>4830853</flowId><status>0</status><doctTech></doctTech><deptCode>27</deptCode><doctCode></doctCode><orderNo>4830853</orderNo></RecordInfo><RecordInfo><tradeTime>2025-03-11 00:00:00</tradeTime><medDate>2025-03-11</medDate><medTime>08:00:00-08:30:00</medTime><deptName>消化内科</deptName><doctName></doctName><parentDeptCode>消化/贫血科/肾内</parentDeptCode><parentdeptName>87</parentdeptName><appoNo>4</appoNo><scheduleId>3|1|33|0</scheduleId><medAmPm>1</medAmPm><address>门诊一楼</address><appoFrom>1</appoFrom><regFee>0</regFee><treatFee>1500</treatFee><regAmount>1500</regAmount><flowId>4830816</flowId><status>0</status><doctTech></doctTech><deptCode>33</deptCode><doctCode></doctCode><orderNo>4830816</orderNo></RecordInfo><RecordInfo><tradeTime>2025-03-11 00:00:00</tradeTime><medDate>2025-03-11</medDate><medTime>10:00:00-10:30:00</medTime><deptName>心血管内科专家门诊</deptName><doctName>刘玉峰</doctName><parentDeptCode>中医科七诊室</parentDeptCode><parentdeptName>172</parentdeptName><appoNo>12</appoNo><scheduleId>3|1|52|2068</scheduleId><medAmPm>1</medAmPm><address>门诊楼三楼</address><appoFrom>1</appoFrom><regFee>0</regFee><treatFee>2500</treatFee><regAmount>2500</regAmount><flowId>4830855</flowId><status>0</status><doctTech>副主任医师</doctTech><deptCode>52</deptCode><doctCode>2068</doctCode><orderNo>4830855</orderNo></RecordInfo></RecordList></ResultData></Response>'
      let QueryRegisterRecord2 = '<?xml version="1.0" encoding="UTF-16LE" standalone="no"?><Response><ResultCode>0</ResultCode><ErrorMsg></ErrorMsg><ResultData><RecordList><RecordInfo><tradeTime>2025-02-06 00:00:00</tradeTime><medDate>2025-02-06</medDate><medTime>08:30:00-09:00:00</medTime><deptName>复发性流产专家门诊</deptName><doctName>陈卫民</doctName><parentDeptCode>妇科综合门诊</parentDeptCode><parentdeptName>261</parentdeptName><appoNo>4</appoNo><scheduleId>5|1|371|8058</scheduleId><medAmPm>1</medAmPm><address>门诊三楼妇科综合诊区</address><appoFrom>1</appoFrom><regFee>0</regFee><treatFee>3000</treatFee><regAmount>3000</regAmount><flowId>3031221</flowId><status>0</status><doctTech>主任医师</doctTech><deptCode>371</deptCode><doctCode>8058</doctCode><orderNo>3031221</orderNo></RecordInfo></RecordList></ResultData></Response>'
      console.log('挂号记录:QueryRegisterRecord')
      let result7 = this.$x2js.xml2js(QueryRegisterRecord)
      let result8 = this.$x2js.xml2js(QueryRegisterRecord2)
      console.log(result7.Response.ResultData);
      console.log(result8.Response.ResultData);
      console.log('***********挂号记录:end***********')
    }
  }

}
</script>

<style scoped lang="scss">
.xml-area {
  font-size: 32px;
  font-family: "Times New Roman", "Lantinghei SC", "Open Sans", Arial, "Hiragino Sans GB", "Microsoft YaHei", STHeiti, "WenQuanYi Micro Hei", SimSun, sans-serif, MicrosoftYaHeiLight, "Microsoft YaHei Light", "Microsoft YaHei", 'iconfont2';
}
</style>